package cn.csc.framework.pay.core.enums.order;

/**
 * @author liuchuang
 * @version 1.0
 * @date 2023/11/7 11:13
 * @modify
 */
public enum PayOrderLklAuthCodeEnum {

    /**
     * 微信	WECHAT	付款码10 11 12 13 14 15开头
     * 支付宝	ALIPAY	付款码25 26 27 28 29 30开头
     * 银联	UQRCODEPAY	付款码62开头
     * 数币人民币	DCPAY	付款码01开头
     * 翼支付	BESTPAY	付款码51开头
     * 苏宁	SUNING	付款码83开头
     */
    WECHAT("10|11|12|13|14|15", "WECHAT"),
    ALIPAY("25|26|27|28|29|30", "ALIPAY"),
    UQRCODEPAY("62", "UQRCODEPAY"),
    DCPAY("01", "DCPAY"),
    BESTPAY("51", "BESTPAY"),
    SUNING("83", "SUNING"),
    UNKNOWN("00", "UNKNOWN"),
    ;

    private final String prefix;
    private final String accountType;

    PayOrderLklAuthCodeEnum(String prefix, String accountType) {
        this.prefix = prefix;
        this.accountType = accountType;
    }

    public static PayOrderLklAuthCodeEnum getAccountType(String prefix){
        switch (prefix){
            case "10":
            case "11":
            case "12":
            case "13":
            case "14":
            case "15":
                return WECHAT;
            case "25":
            case "26":
            case "27":
            case "28":
            case "29":
            case "30":
                return ALIPAY;
            case "62":
                return UQRCODEPAY;
            case "01":
                return DCPAY;
            case "51":
                return BESTPAY;
            case "83":
                return SUNING;
            default:
                return UNKNOWN;
        }
    }

}
